﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Collections;
using Webchatting.Common;
using Webchatting.Dal;

public partial class server_EditPwdQuestion : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            OperationRU ORUser1 = new OperationRU();
            FormsIdentity id1 = (FormsIdentity)User.Identity;
            IList<string> ilist = new List<string>();
            ilist = ORUser1.GetRUSafeInfo(id1.Ticket.UserData.Split('@')[0]);

            txtPwd.Text = ilist[0];

            txtQuestion.Text = ilist[1];
            txtAnswer.Text = ilist[2];
        }
       
    }
    protected void btnEditSummit_Click(object sender, EventArgs e)
    {
        OperationRU ORUser = new OperationRU();
        FormsIdentity id = (FormsIdentity)User.Identity;
        ORUser.UpdateRUSafeInfo(id.Ticket.UserData.Split('@')[0], txtQuestion.Text, txtAnswer.Text, txtPwd.Text);
        Response.Write("<script>alert('修改成功!');window.parent.location.href='RUIndex.aspx';</script>");

    }
}
